Re: Connection pooling - Mailing list pgsql-general

From Steve Leibel
Subject Re: Connection pooling
Date
Msg-id v0421012eb69771e90c7a@[24.168.80.161]
Whole thread Raw
In response to Re: Connection pooling  (Gilles DAROLD <gilles@darold.net>)
List pgsql-general
At 12:39 PM +0100 1/26/01, Gilles DAROLD wrote:
>Hi,
>
>Just to repeat that we have this stuff enabled using perl and mod_perl for a
>very
>long time. Just try to declare all your vars as global (without my or local)
>and
>see what's append between apache child process :-)
>
>But as I know Apache::DBI doesn't do db connexion pooling, this is a
>mistake.
>It just allows you to create persitante connexion. But you can declare
>multiple
>persistante connection and do a random access to each one if your really
>need
>to play with that. Personnaly I never had to use that, but I think that with
>a site
>with a large amout of simoultaneous user it can be usefull.



The point is that if two child processes share a connection (which is
actually just a TCP or Unix socket) then you have two writers to the
same output channel.  This is a no-no, since data corruption can
result, just as if two writers share an open filehandle for writing.

It would in theory be possible for somebody to write a connection
pool package for Apache that included proper concurrency control.
However Apache::DBI doesn't do that.

Steve L


pgsql-general by date:

Previous
From: "Thomas T. Thai"
Date:
Subject: FOUND Re: concat for pgsql?
Next
From: Tom Lane
Date:
Subject: Re: Performance: Unix sockets vs. TCP/IP sockets